
package com.catsic.pub.specification;

import com.catsic.base.specification.BaseSpec;
import com.catsic.base.specification.QueryWraper;
import com.catsic.pub.condition.FileUploadCondition;
import com.catsic.pub.entity.FileUpload;
/**
 * ClassName: UserSpec
 * Description: UserSpec
 * date: 2013年4月28日 下午2:30:29
 * author: yangyd
 */
public class FileUploadSpec extends BaseSpec<FileUpload> {

	public FileUploadSpec(FileUploadCondition condition){
		super(condition);
	}
	
	/**
	 * @see com.catsic.core.specification.BaseSpec#addCondition(com.catsic.core.specification.QueryWraper)
	 */
	@Override
	protected void addCondition(QueryWraper<FileUpload> queryWraper) {
		addEqualCondition(queryWraper, "fid");
		addLikeCondition(queryWraper, "fileName");
		addLikeCondition(queryWraper, "randomFileName");
		addLikeCondition(queryWraper, "note");
		/**
		 * 自定义排序
		 */
		queryWraper.addOrder(queryWraper.getCb().desc(queryWraper.getRoot().get("randomFileName")));
	}
}
